Skip to main content

echarts-Vanilla 引入eCharts

#Lib #Echarts


<div id="app"></div>
<srcipt src="echarts.js"></script>
div {
width : 200px;
height : 200px
}
const myCharts = echarts.init(document.getElementById('app'))
const xAxisArr = []
const yAxisArr = []
myCharts.setOptions({
xAxis: {
type: 'category',
data: xAxisArr,
},
yAxis: {
type: 'value',
data: []
},
series: [
{
type: 'Line/Bar/pie',
data: yAxisArr
}
]
})